<?php
/**
 * Builds up a programmatic model for stacked SQL options to be used by SELECT query.
 * 
 * Note: MySQL uses this clause also for INSERT, UPDATE, DELETE, REPLACE, ALTER
 */
class SQLOptionsClause extends AbstractSQLClause{
	/**
	 * Sets up options fields directly from constructor.
	 * 
	 * @example $tblOptions = array("DISTINCT","SQL_CALC_FOUND_ROWS")
	 * @param array(string) $tblOptions
	 */
	public function __construct($tblOptions) {
		foreach($tblOptions as $strOption) {
			$this->tblContents[]=$strOption;
		}
	}

	/**
	 * Transforms clause to string
	 * 
	 * @example DISTINCT SQL_CALC_FOUND_ROWS
	 * @see AbstractSQLClause::toString()
	 */
	public function toString() {
		return implode(" ",$this->tblContents);
	} 
}